negotiator.bidding
Class BidStrictSorterUtility

java.lang.Object
  extended by negotiator.bidding.BidStrictSorterUtility
All Implemented Interfaces:
java.util.Comparator<Bid>

public class BidStrictSorterUtility
extends java.lang.Object
implements java.util.Comparator<Bid>

Comparator which sorts a set of Bids based on their utility. The bid with the highest utility is on the front of the list. In addition, the ordering is unique: bids with exactly the same utility are always ordered the same. Use this class ONLY when comparing if two strategies are equivalent.

Author:
Mark Hendrikx

Constructor Summary
BidStrictSorterUtility(UtilitySpace utilitySpace)
          Initializes the comperator by setting the bidding space.
 
Method Summary
 int compare(Bid b1, Bid b2)
          Comperator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

BidStrictSorterUtility

public BidStrictSorterUtility(UtilitySpace utilitySpace)
Initializes the comperator by setting the bidding space. The utility space is necessary to evaluate the utility of the bids.

Parameters:
utilitySpace - used to evaluate the utility of the bids.
Method Detail

compare

public int compare(Bid b1,
                   Bid b2)
Comperator. If util b1 > b2 then -1, else if < then 1, else compare hashcodes.

Specified by:
compare in interface java.util.Comparator<Bid>